package com.example.finalapplication;

import androidx.appcompat.app.AppCompatActivity;

import android.annotation.SuppressLint;
import android.app.Application;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.TextPaint;
import android.text.method.LinkMovementMethod;
import android.text.style.BackgroundColorSpan;
import android.text.style.ClickableSpan;
import android.view.View;
import android.widget.TextView;

import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.ScheduledFuture;

public class MainActivity extends AppCompatActivity {
    private static final String TAG = "MainActivity";

    @SuppressLint("WrongViewCast")
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        TextView textView = findViewById(R.id.textView);
        SpannableString ss = new SpannableString("运动健康管理助手");
        ss.setSpan(new ClickableSpan(){

            @Override
            public void onClick(View widget){
                Intent intent = new Intent(MainActivity.this,MainActivity1.class);
                startActivity(intent);
            }},0,8, Spanned.SPAN_INCLUSIVE_INCLUSIVE);

             textView.setText(ss);
             textView.setMovementMethod(LinkMovementMethod.getInstance());
    }

}